package main

import (
	"doctor/conf"
	"doctor/models"
	_ "doctor/routers"
	beego "github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/server/web/filter/cors"
)

func main() {

	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
		AllowCredentials: true,
		AllowHeaders:     []string{"*"},
		AllowMethods:     []string{"*"},
		AllowOrigins:     []string{"*"},
		AllowAllOrigins:  true,
	}))

	conf.Init()
	models.MysqlInit()
	beego.Run()
}
